﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _MetalSlug.MyCharacters.Characters.Guns
{
    public class GunFactory
    {
        static GunFactory Instance;
        List<Gun> guns;

        public List<Gun> Guns
        {
          get { return guns; }
          set { guns = value; }
        }

        protected GunFactory()
        {
            Guns = new List<Gun>();
            Guns.Add(new MiniGun());
            Guns.Add(new ShotGun());
        }

        public static GunFactory GetInstance()
        {
            if (Instance == null)
            {
                Instance = new GunFactory();
            }
            return Instance;
        }

        public Gun GetGun(Gun.TYPE Type)
        {
            for (int i = 0; i < Guns.Count; i++)
            {
                if (Guns[i].TypeOfGun == Type)
                {
                    return Guns[i].Clone();
                }
            }

            return null;
        }
    }
}
